﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
/// <summary>
/// assetbundle资源接口
/// </summary>
public interface IAssetBundle
{

    void CreateRes(string bundleName);

    void CreateRes(string bundleName, Action callback);

    //void CreateRes()
    /// <summary>
    /// 引用次数
    /// </summary>
    /// <returns></returns>
    int ReferenceCount();

    /// <summary>
    /// 增加引用次数
    /// </summary>
    void AddReferenceCount();

    /// <summary>
    /// 减少引用次数
    /// </summary>
    void SubReferenceCount();

    /// <summary>
    /// 释放资源    
    /// </summary>
    void ReleaseRes();

    /// <summary>
    /// 加载资源
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <param name="assetName"></param>
    /// <returns></returns>
    T LoadRes<T>(string assetName) where T : UnityEngine.Object;

    /// <summary>
    /// 是否加载完毕
    /// </summary>
    /// <returns></returns>
    bool IsDone();

    ///// <summary>
    ///// 获取AssetName名字
    ///// </summary>
    ///// <returns></returns>
    //string GetAssetName();

    /// <summary>
    /// 获取AB名字
    /// </summary>
    /// <returns></returns>
    string GetABName();

    /// <summary>
    /// 获取ab资源
    /// </summary>
    /// <returns></returns>
    AssetBundle GetAssetBundle();

    void UnLoadAB();

}
